<%@page import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<script type="text/javascript">	

   function myKnowledgeMenuTree_onNodeClick2(event, treeId, treeNode) {
		if (treeNode.id == '1') {
			$("#myKnowledgeState").val(" select knowledge_itemid from kng_myfavorite ");
		} else {
			$("#myKnowledgeState").val(" select id from kng_knowledge_item where creator='<%=ContextHolder.getLoginUsername()%>'");
		}
		myKnowledgeMenuTree_onNodeClick(event, treeId, treeNode);
	}
//-->
</script>
<isperp:grid url="knowledge/knowledgeItem/listDetail"
	gridId="knowledgeItemGrid"  datatype="local"
	cusViewUrl="knowledge/knowledgeSearch/knowledgeInfoView"
	ondbClickRowEvent="knowledgeItemGrid.view(rowid);"
	afterGridCreate="myKnowledgeMenuTree_onNodeClickFirst();">


	<jsp:attribute name="toolbar">
	<isperp:treeMenu id="myKnowledgeMenu" targetGridId="knowledgeItemGrid"
			nodes="[{id:1,name:'我的收藏夹'},{id:2,name:'我创建的'}]">
		<isperp:async enable="false"></isperp:async>
		<isperp:data simpleData="true"></isperp:data>
		<isperp:callback onClick="myKnowledgeMenuTree_onNodeClick2">
		</isperp:callback>
	</isperp:treeMenu>
	</jsp:attribute>
	<jsp:attribute name="searchbar">
		
	<table class="search-table">
		<tbody>
			<tr>
				<td align="right">标题：</td>
				<td><input type="hidden"
			value=" select knowledge_itemid from kng_myfavorite "  class="constvalue"
			id="myKnowledgeState" field="id" op="in"><input type="text" field="title" op="cn">
				</td>
				
				<td align="right">创建日期：</td>
				<td><input id="createDateStart" type="date" field="create_date"
						op="gt" style="width: 68px" />~<input id="createDateEnd"
						type="date" field="create_date" op="lt" style="width: 68px" />
					</td>
			</tr>
		</tbody>
	</table>
	</jsp:attribute>
	<jsp:body>

	<isperp:column name="id" title="id" hidden="true"></isperp:column>
	<isperp:column name="title" title="标题" width="150">
	</isperp:column>
	<isperp:column name="keyword" title="关键字" width="80">
	</isperp:column>
	<isperp:column name="treenode_name_path" title="分类" width="100">
	</isperp:column>
	<isperp:column name="creator_name" title="创建人" width="60">
	</isperp:column>
	<isperp:column name="create_date" title="创建时间" width="80">
	 </isperp:column>
	<isperp:column name="status" title="状态" width="50">
	</isperp:column>
	</jsp:body>
</isperp:grid>
